﻿// ==================================================================================================================
//        ,::i                                                           BBB
//       BBBBBi                                                         EBBB
//      MBBNBBU                                                         BBB,
//     BBB. BBB     BBB,BBBBM   BBB   UBBB   MBB,  LBBBBBO,   :BBG,BBB :BBB  .BBBU  kBBBBBF
//    BBB,  BBB    7BBBBS2BBBO  BBB  iBBBB  YBBJ :BBBMYNBBB:  FBBBBBB: OBB: 5BBB,  BBBi ,M,
//   MBBY   BBB.   8BBB   :BBB  BBB .BBUBB  BB1  BBBi   kBBB  BBBM     BBBjBBBr    BBB1
//  BBBBBBBBBBBu   BBB    FBBP  MBM BB. BB BBM  7BBB    MBBY .BBB     7BBGkBB1      JBBBBi
// PBBBFE0GkBBBB  7BBX   uBBB   MBBMBu .BBOBB   rBBB   kBBB  ZBBq     BBB: BBBJ   .   iBBB
//BBBB      iBBB  BBBBBBBBBE    EBBBB  ,BBBB     MBBBBBBBM   BBB,    iBBB  .BBB2 :BBBBBBB7
//vr7        777  BBBu8O5:      .77r    Lr7       .7EZk;     L77     .Y7r   irLY  JNMMF:
//               LBBj
//
// Apworks Application Development Framework
// Copyright (C) 2010-2015 by daxnet.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//    http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ==================================================================================================================

using Apworks.Config;
using Castle.DynamicProxy;
using System;
using System.Collections.Generic;

namespace Apworks.Application
{
    /// <summary>
    /// Represents that the implemented classes are Apworks applications. 
    /// </summary>
    public interface IApp
    {
        /// <summary>
        /// Gets the <see cref="Apworks.Config.IConfigSource" /> instance that was used for
        /// configuring the application.
        /// </summary>
        IConfigSource ConfigSource { get; }

        /// <summary>
        /// Gets the <see cref="Apworks.IObjectContainer" /> instance with which the application
        /// registers or resolves the object dependencies.
        /// </summary>
        ObjectContainer ObjectContainer { get; }

        /// <summary>
        /// Gets a list of <see cref="Castle.DynamicProxy.IInterceptor" /> instances that are
        /// registered on the current application.
        /// </summary>
        IEnumerable<IInterceptor> Interceptors { get; }

        /// <summary>
        /// Starts the application. 
        /// </summary>
        void Start();

        /// <summary>
        /// The event that occurs when the application is initializing. 
        /// </summary>
        event EventHandler<AppInitEventArgs> Initialize;
    }
}